ScxV6Object.Convert Method

Converts the object into another type of object.

Parameters

Remarks

Use the Convert method to convert a database object from one type to another.

The conversion operation may fail if:

Example:

The following example written in VB.NET uses the Convert method to convert an internal analogue point into a modbus analogue:

Dim Svr As ScxV6DbClient.ScxV6Server

' Connect to the server

Dim Svr As ScxV6DbClient.ScxV6Server

' Connect to the server

Svr = New ScxV6DbClient.ScxV6Server

Svr.Connect("MAIN", "", "")

Dim Obj As ScxV6DbClient.ScxV6Object

Obj = Svr.FindObject("Group.Test Point")

' Set the format on the internal analogue. This will be preserved when converted

Obj.Interface.Format = "0.00"

Console.WriteLine("Class before conversion: {0}", Obj.Class.Name)

Try

Obj.Convert("CModbusPointAlg")

Catch ex As Exception

' Output any warnings/errors

Console.WriteLine("Warnings detected:")

Console.WriteLine(ex.Message)

Console.WriteLine("")

End Try

Console.WriteLine("Class after conversion: {0}", Obj.Class.Name)

Console.WriteLine("Format after conversion: {0}", Obj.Interface.Format)

' Disconnect

Svr.Disconnect()

This produces the following output:

Class before conversion: CPointAlgManual

Warnings detected:

Point requires a scanner.

Class after conversion: CModbusPointAlg

Format after conversion: 0.00


Disclaimer

Geo SCADA Expert 2020